﻿using BLL.Dal;
using BLL.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SysAdmin_Role_Edit : System.Web.UI.Page
{
    public string role_key;
    public string role_name;
    public string power_ids;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindData();
        }
    }

    /// <summary>
    /// 初始化数据绑定
    /// </summary>
    void bindData()
    {
        if (Request["role_key"] != null)
        {
            RoleDAL roleBus = new RoleDAL();
            Role model = roleBus.GetModel(Request["role_key"]);
            if (model != null)
            {
                role_key = model.roleCode;
                role_name = model.roleName;
                power_ids = "['" + model.powerCodes.Replace(",", "','") + "']";
                //power_ids = "'"+model.powerCodes+"'";
            }
        }
    }
}